#include <REGX52.H>
#include <LCD1602.H>
#include <XPT2406.H>
#include <delay.H>

unsigned int ADValue;

void main()
{
	LCD_Init();
	LCD_ShowString(1,1,"ADJ  NTC  GR");
	while(1)
	{
		ADValue=XPT2046_ReadAD(XPT2046_XP_12);		//读取AIN0，可调电阻
		LCD_ShowNum(2,1,ADValue,4);					//显示AIN0
		ADValue=XPT2046_ReadAD(XPT2046_YP_12);		//读取AIN1，热敏电阻
		LCD_ShowNum(2,6,ADValue,3);					//显示AIN1
		ADValue=XPT2046_ReadAD(XPT2046_VBAT_12);		//读取AIN2，光敏电阻
		LCD_ShowNum(2,11,ADValue,3);				//显示AIN2
		Delay(10);
	}
}
